﻿//wmts服务
function TileXYZService(layerInfo) {
    var TileXYZService = new Object;
    TileXYZService.id = layerInfo.hasOwnProperty("GUID") ? layerInfo.GUID : "";
    TileXYZService.url = layerInfo.hasOwnProperty("URL") ? layerInfo.URL : "";
    TileXYZService.name = layerInfo.hasOwnProperty("NAME") ? layerInfo.NAME : "";
    TileXYZService.servertype = layerInfo.hasOwnProperty("SERVERTYPE") ? layerInfo.SERVERTYPE : "";
    TileXYZService.prj = layerInfo.hasOwnProperty("PRJ") ? layerInfo.PRJ : "";
    TileXYZService.CreateLayer = function () {
        var id = this.id;
        var url = this.url;
        var name = this.name;
        var servertype = this.servertype;
        var prj = this.prj;
        var thisLayer = new ol.layer.Tile({
            source: new ol.source.XYZ({
                url: url,
                title: name,
                id: id,
                wrapX: false
            }),
            projection: prj
        });
        return thisLayer;
    }
    return TileXYZService;
}